const nodata = require('../tw-lib-base/no-data/props')
const commonProps = require('../tw-lib-base/chart/common-props')
const axisProps = require('../tw-lib-base/chart/axis-props')
const datazoomProps = require('../tw-lib-base/chart/datazoom-props')
const tooltipProps = require('../tw-lib-base/chart/tooltip-props')

module.exports = {
  ...commonProps,

  ...axisProps,
  ...datazoomProps,
  ...tooltipProps,

  data: {
    type: Array,
    default () {
      return [
        {
          name: '职称',
          data: [
            [1,1,45,125,0.82,34,23,"良"],
            [2,2,27,78,0.86,45,29,"良"],
            [3,3,60,84,1.09,73,27,"良"],
            [4,4,81,121,1.28,68,51,"轻度污染"],
            [5,5,77,114,1.07,55,51,"轻度污染"],
            [6,6,81,121,1.28,68,51,"轻度污染"],
            [7,7,77,114,1.07,55,51,"轻度污染"],
            [8,8,65,78,0.86,51,26,"良"],
            [9,9,33,47,0.64,50,17,"良"],
            [10,10,55,80,1.01,75,24,"良"],
            [11,11,81,124,1.03,45,24,"轻度污染"],
            [12,12,71,142,1.1,62,42,"良"],
            [13,13,69,130,1.28,74,50,"良"],
            [14,14,87,131,1.47,84,40,"轻度污染"],
            [15,15,80,121,1.3,85,37,"轻度污染"],

          ]
        }
      ]
    },
    name: '外图表数据集',
    filedType: 'api'
  },
  yLabel: {
    type: String,
    default: '',
    name: 'Y坐标轴单位',
    filedType: 'string'
  },

  xLabel: {
    type: String,
    default: '',
    name: 'X坐标轴单位',
    filedType: 'string'
  },
  xNamePadding: {
    type: String,
    default: '',
    name: 'X轴名称位置偏移',
    filedType: 'string'
  },

  yNamePadding: {
    type: String,
    default: '',
    name: 'Y轴名称位置偏移',
    filedType: 'string'
  },
  axisTickInterval: {
    type: String,
    default: '0',
    name: '坐标刻度间隔',
    filedType: 'string'
  },
  showXSplitLine: {
    type: Boolean,
    default: false,
    name: '显示X轴分隔线',
    filedType: 'switch'
  },
  splitLineType: {
    type: String,
    default: 'solid',
    name: '分隔线类型',
    filedType: 'select',
    options: [
      {
        name: 'solid',
        value: 'solid'
      },
      {
        name: 'dashed',
        value: 'dashed'
      },
      {
        name: 'dotted',
        value: 'dotted'
      }
    ],
    // 是否支持多选，支持多选时default要指定为数组
    multiple: false
  },
  ylabelPadding: {
    type: String,
    default: '',
    name: 'Y轴标签偏移',
    filedType: 'string'
  },
  yAxisMin: {
    type: String,
    default: '0',
    name: '左Y坐标最小值',
    filedType: 'string'
  },

  yAxisMax: {
    type: String,
    default: '15',
    name: '左Y坐标最大值',
    filedType: 'string'
  },

  yAxisSplitNumber: {
    type: String,
    default: '15',
    name: '左Y坐标分段数',
    filedType: 'string'
  },

  useXAxisFun: {
    type: Boolean,
    default: false,
    name: '启用坐标刻度函数',
    filedType: 'switch'
  },
  funcAxisLabel: {
    type: Function,
    default: 'function (value) {let text = "L" + value; return text;}',
    name: 'X坐标刻度函数',
    filedType: 'function'
  },
  useYAxisFun: {
    type: Boolean,
    default: false,
    name: '启用坐标刻度函数',
    filedType: 'switch'
  },
  funcYAxisLabel: {
    type: Function,
    default: 'function (value) {let index = -1; if (value.length > 6) {index = 6;}let text = value;if (index > 0) { text = `${text.slice(0, 6)}\n${text.slice(6)}`;} return text;}',
    name: 'Y坐标刻度函数',
    filedType: 'function'
  },
  triggerType: {
    type: String,
    default: 'item',
    name: '触发类型',
    filedType: 'select',
    options: [
      {
        name: 'axis',
        value: 'axis'
      },
      {
        name: 'item',
        value: 'item'
      }
    ],
    // 是否支持多选，支持多选时default要指定为数组
    multiple: false
  },
  useTooltipFun: {
    type: Boolean,
    default: false,
    name: '启用tooltip函数',
    filedType: 'switch'
  },
  funcTooltip: {
    type: Function,
    default: 'function (obj) {console.log(obj);let value=obj.value; return " " + obj.seriesName + " " + "</br> 哈哈：" + value[2] + "</br> 呵呵：" + value[3]}',
    name: 'tooltip触发函数',
    filedType: 'function'
  },
  visualMapMin: {
    type: String,
    default: '0',
    name: '尺寸映射最小值',
    filedType: 'string'
  },

  visualMapMax: {
    type: String,
    default: '150',
    name: '尺寸映射最大值',
    filedType: 'string'
  },
  visualMapMin1: {
    type: String,
    default: '0',
    name: '颜色映射最小值',
    filedType: 'string'
  },

  visualMapMax1: {
    type: String,
    default: '150',
    name: '颜色映射最大值',
    filedType: 'string'
  },

  useSeries: {
    type: Boolean,
    default: false,
    name: '启用定制series',
    filedType: 'switch'
  },
  funcSeries: {
    type: Function,
    default: '',
    name: '定制series函数',
    filedType: 'function'
  },

  ...nodata
}
